package com.oa.controller;

import com.oa.beans.Menu;
import com.oa.service.MenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author 杨浩军
 * @version v1.0
 * @dateTime 2025/3/10 15:01
 */
@RestController
@CrossOrigin
public class MenuController {

    @Autowired
    private MenuService menuService;

    @GetMapping("/tree")
    public List<Menu> getMenuTree() {
        return menuService.getMenuTree();
    }

}
